// FundsServiceImpl.java
package com.sms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sms.mapper.FundsMapper;
import com.sms.pojo.Funds;
import com.sms.service.FundsService;
import com.sms.util.SqlSessionFactoryUtil;
import lombok.Getter;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Getter
public class FundsServiceImpl extends ServiceImpl<FundsMapper,Funds> implements FundsService{

    SqlSession sqlSession=null;

    @Override
    public FundsMapper getBaseMapper() {
        SqlSessionFactory factory = SqlSessionFactoryUtil.getFactory();
        sqlSession=factory.openSession(true);
        FundsMapper mapper = factory.getConfiguration().getMapper(FundsMapper.class, sqlSession);
        return mapper;
    }


    @Override
    public List<Funds> listFunds() {
        return this.getBaseMapper().listFunds();
    }
}
